<!-- 出库订单详情 -->
<template>
  <div class="page-container" v-loading="loading" v-loadingCommonStyle>
    <ex_header_spiler :title="$tt('label_tms_task_base_info')" />
    <ex_super_desc :model="baseModel" :data="form.tmsWaybillTaskInfoDTO" size="default" direction="vertical" :attrs="$defaultDetailDescAttrs"
      border labelClassName="widthdiv4" contentClassName="widthdiv4">
    </ex_super_desc>
    <ex_header_spiler :title="$tt('label_tms_waybill_order_info')" />
    <ex_super_table :model="orderModel" :data="form.tmsOrderInfoDTOList" height="300">
    </ex_super_table>
    <ex_header_spiler :title="$tt('label_tms_waybill_carrier_info')" />
    <ex_super_table :model="carrierModel" :data="form.carrierAndDriverDTOList" height="300">
    </ex_super_table>
  </div>
</template>
<script>
import router_params from '@/mixin/router_params';

export default {
  title: "label_tms_waybill_task_detial",
  mixins: [router_params],
  components: {},
  data() {
    return {
      loading: false,
      form: {},
      baseModel: [
        { key: 'waybillTaskCode', label: 'label_tms_task_number', },
        { key: 'schemeName', label: 'label_tms_line_operation_project', },
        { key: 'carrierName', label: 'label_tms_waybill_carrier_name', },
        {
          key: 'status', label: 'label_tms_waybill_waybill_main_status', 'min-width': 120, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$enumShow(v, "TmsTaskStatusEnum")
        },
        {
          key: 'startAddress', label: 'label_tms_receipt_commence_address', span: 2,
          formatter: (r, c, v, i) => [r.originProvinceName, r.originCityName, r.originCountyName, r.originAddress,].join('')
        },
        {
          key: 'endAddress', label: 'label_tms_waybill_destination', span: 2,
          formatter: (r, c, v, i) => [r.destinationProvinceName, r.destinationCityName, r.destinationCountyName, r.destinationAddress,].join('')
        },

        { key: 'requireCompleteTime', label: 'label_tms_track_completion_time', formatter: (r, c, v, i) => this.$dateFormat(v) },
        {
          key: 'remark', label: 'label_remark', span: 2,

        },


        { key: 'creator', label: 'label_create_user', },
        { key: 'gmtCreate', label: 'label_create_time', formatter: (r, c, v, i) => this.$dateFormat(v) },

        { key: 'modifier', label: 'label_update_user', },
        { key: 'gmtModify', label: 'label_fms_currency_update_date', formatter: (r, c, v, i) => this.$dateFormat(v) },

      ],
      orderModel: [
        { key: 'refOrderCode', label: 'label_order_code', 'show-overflow-tooltip': true, },
        { key: 'trackNumber', label: 'label_track_code', 'show-overflow-tooltip': true, },
        {
          key: 'customerName', label: 'label_customer_info', 'width': 140, 'show-overflow-tooltip': true,
          formatter: (r, c, v, i) => this.$formatNameCode(v, r.customerCode)
        },
        { key: 'productName', label: 'label_logistics', 'width': 140, 'show-overflow-tooltip': true, },
        {
          key: 'deliveryAddress', label: 'label_tms_waybill_original_place', 'min-width': 140, 'show-overflow-tooltip': true,
          //formatter: (r, c, v, i) => [r.deliveryProvinceName, r.deliveryCityName, r.deliveryCountyName, r.deliveryAddress,].join('/')
        },
        {
          key: 'receiptAddress', label: 'label_tms_waybill_destination', 'min-width': 140, 'show-overflow-tooltip': true,
          //formatter: (r, c, v, i) => [r.receiptProvinceName, r.receiptCityName, r.receiptCountyName, r.receiptAddress,].join('/')
        },
        { key: 'receiptUserName', label: 'label_tms_track_consignee', 'width': 140, 'show-overflow-tooltip': true, },
        { key: 'receiptContacts', label: 'label_tms_waybill_consignee_contact', 'width': 140, 'show-overflow-tooltip': true, },
        { key: 'gmtCreate', label: 'label_create_time', 'width': 130, formatter: (r, c, v, i) => this.$dateFormat(v) },
        { key: 'remark', label: 'label_remark', 'width': 140, 'show-overflow-tooltip': true, },

      ],
      carrierModel: [

        { key: 'carrierName', label: 'label_tms_common_carrier', 'min-width': 140, 'show-overflow-tooltip': true, },
        { key: 'configTypeName', label: 'label_tms_config_type', 'min-width': 140, 'show-overflow-tooltip': true, },
        { key: 'prescription', label: 'label_tms_track_prescription_time', 'width': 140, 'show-overflow-tooltip': true, },

        { key: 'driverName', label: 'label_tms_driver_driver_name', 'width': 140, 'show-overflow-tooltip': true, },

        { key: 'vehicleNo', label: 'label_tms_vehicle_license_number', 'width': 140, 'show-overflow-tooltip': true, },
        { key: 'driverPhone', label: 'label_tms_driver_phone_number', 'width': 140, 'show-overflow-tooltip': true, },




      ],
    };
  },

  computed: {

  },

  methods: {
    init_data_default(into_params) {
      if (into_params.id) {
        this.loading = true
        this.$ajax({
          url: "/tms-api/waybill/TmsTaskInfoQueryRpc/selectDetail.json",
          method: 'post',
          data: { id: into_params.id },
          success: (res) => {
            this.loading = false
            this.form = Object.assign({}, res.data)
            this.$emit("tagModifyLabel", {
              _key: 'label_name_code', name: this.$tt("label_tms_waybill_task_detail"),
              code: res.data.tmsWaybillTaskInfoDTO.waybillTaskCode || ""
            })


          }
        })
      }
      this.$emit('tagModifyLabel', "label_tms_waybill_task_detail")
    },

  }
};

</script>
<style></style>
